

import {reqGetSearchInfo} from '@/api'


const state = {
    searchlist:{}
}
const mutations ={
    GETSEARCHINFO(state,searchlist){
        state.searchlist = searchlist
    }
};
const actions = {
async getSearchInfo({commit},params={}){
    let result = await reqGetSearchInfo(params)

    if (result.code == 200) {
        commit('GETSEARCHINFO',result.data)
    }
 }
};

const getters = {
    attrsList(state){
        return state.searchlist.attrsList||[]
    },
    goodsList(state){
        return state.searchlist.goodsList||[]
    },
    trademarkList(state){
        return state.searchlist.trademarkList||[]
    }
};

export default{
    state,
    mutations,
    actions,
    getters
}